from django.db import models


class Category(models.Model):

    name = models.CharField(max_length=20)


class Course(models.Model):

    title = models.CharField(max_length=100)
    category = models.ForeignKey('Category',on_delete=models.CASCADE)
    teacher = models.CharField(max_length=100)
    teacher_desc = models.CharField(max_length=255)
    video_url = models.CharField(max_length=255)
    image_url = models.CharField(max_length=255)
    price = models.FloatField(default=0)
    duration = models.FloatField(null=True)
    course_desc = models.TextField(null=True)
    catalog = models.CharField(max_length=255,null=True)
    pub_time = models.DateTimeField(auto_now_add=True,null=True)

